Skip to content

Conversation

nakul-py
Copy link

@nakul-py nakul-py commented Aug 8, 2025

Adding multi chats pannel to @jypyter/chat package and removing it from jyputerlab-chat. Now it can be easily imported and usable in juputerlab-chat and jupyterlite/ai.

Copy link
Contributor

github-actions bot commented Aug 8, 2025

Binder 👈 Launch a Binder on branch nakul-py/jupyter-chat/multichatpanel

@brichet
Copy link
Collaborator

brichet commented Aug 8, 2025

Thanks @nakul-py for working on this.

I feel like this PR is not ready for review yet (e.g. we should not need the content manager in that chat, IMO).
Don't you think it should be converted to draft?

FYI I added some thoughts about this change in the issues.

@nakul-py nakul-py marked this pull request as draft August 8, 2025 11:37
@nakul-py
Copy link
Author

nakul-py commented Aug 12, 2025

@brichet These things have done:

  • Defined ready promise in the AbstractChatModel.
  • Defined IInputToolbarRegistry in @jupyter/chat.
  • Added the Rename chat button.

Will you Test it now and suggest some improvements?

@nakul-py nakul-py marked this pull request as ready for review August 12, 2025 11:58
@brichet
Copy link
Collaborator

brichet commented Aug 12, 2025

Thanks @nakul-py for updating it.
FYI I won't be able to review it until September.

@brichet brichet added the enhancement New feature or request label Aug 12, 2025
@nakul-py
Copy link
Author

nakul-py commented Aug 12, 2025

Thanks @nakul-py for updating it. FYI I won't be able to review it until September.

Ok @brichet i am looking forward for you to come back

@nakul-py
Copy link
Author

nakul-py commented Aug 14, 2025

bot please update snapshots

Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @nakul-py for working on this, this is not an easy change.

This is not a full review.
My main comment is that there shouldn't be any notion of file/path in the generic multi-chat panel (@jupyter/chat) and section, this is only relevant for the jupyterlab-chat widget.

That said, I don't have a clear view of the best way to create a multi-chat panel in jupyterlab-chat:

  • we can create a MultiChatPanel with functions in options to create, rename, open (your current implementation)
  • we can have a new class in jupyterlab-chat that inherits from MultiChatPanel, and overrides some of its methods

If you prefer, I can also take it from now, and push in your PR.

}

const contentsManager = new ContentsManager();
await contentsManager.rename(oldPath, newPath);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be any reference to path in this widget.
The notion of file/path is relevant only for jupyterlab-chat, which uses collaborative documents as chat.

widget: ChatWidget;
path: string;
defaultDirectory: string;
openChat: (path: string) => void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used in the ChatSection I think, only in the panel.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openChat is used by moveToMain button.
But moveToMain is actually not used anywhere inside ChatSection, so we should remove it

/**
* Promise that resolves when the model is ready.
*/
readonly ready: Promise<void>;
Copy link
Collaborator

@brichet brichet Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
readonly ready: Promise<void>;
get ready(): Promise<void> {
return this._readyDelegate.promise;
}

We could use a getter here.

@@ -677,6 +698,7 @@ export abstract class AbstractChatModel implements IChatModel {
private _id: string | undefined;
private _name: string = '';
private _config: IConfig;
private _readyDelegate: PromiseDelegate<void>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private _readyDelegate: PromiseDelegate<void>;
private _readyDelegate = new PromiseDelegate<void>();

Not sure it needs to be set in the constructor.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the constructor doesn’t need to do anything for it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This widget should probably be located in src/widgets for consistency.

@nakul-py
Copy link
Author

nakul-py commented Sep 4, 2025

If you prefer, I can also take it from now, and push in your PR.

Ok @brichet you can also work on this pr and now renaming, opening, closing and movetomain functions all are working fine.

@nakul-py nakul-py requested a review from brichet September 4, 2025 03:35
@brichet
Copy link
Collaborator

brichet commented Sep 5, 2025

If you prefer, I can also take it from now, and push in your PR.

Ok @brichet you can also work on this pr and now renaming, opening, closing and movetomain functions all are working fine.

Thanks @nakul-py, I'll probably push some commits in the next days.

@brichet brichet marked this pull request as draft September 5, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Add a multi chats side panel in @jupyter/chat package
2 participants